package design_pattern.chain.demo01;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-16 14:15:04
 * @ClassName : design_pattern.chain.demo01.Handler
 * @Description : 处理请求的抽象类，所有的处理器都要继承这个抽象类
 */
public abstract class Handler {

    protected Handler successor;

    /**
     * 设置继任者
     * @param successor 继任者
     */
    public void setSuccessor(Handler successor) {
        this.successor = successor;
    }

    /**
     * 处理请求的抽象方法
     * @param request 对请求的模拟
     */
    public abstract void handleRequest(int request);
}
